package com.healthy.entity;

import java.util.HashSet;
import java.util.List;
import java.util.Set;

import javax.validation.constraints.Pattern;

import org.hibernate.validator.constraints.Email;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
/**
 * @author Maple.Chen
 * @date 2020年6月10日
 * @description <p>用户实体类</p>
 */
@JsonIgnoreProperties(value = {"handler"})
public class YgUsers implements java.io.Serializable{
	/**
	 * 
	 */
	private static final long serialVersionUID = -6467041220160310008L;
	// 用户实体类，主键，UUID
	private String uid;
	// 用户用于登录的账号
	@Pattern(message="请输入长度不超过11的字符",regexp="\\w{1,11}")
	private String username;
	// 用户用于登录的密码
	@Pattern(message="请输入长度为5到11的字母或者数字",regexp="[a-zA-Z0-9]{5,111}")
	private String password;
	// 用户用于登录的昵称
	@Pattern(message="请输入长度不超过12的字符",regexp="[a-zA-Z0-9\u4E00-\u9FA5]{1,12}")
	private String nickname;
	// 用户联系电话
	@Pattern(message="请输入正确的手机号码",regexp="[0-9]{5,11}")
	private String mobile;
	// 用户的邮箱，可用于找回密码
	@Email(message="请输入正确的邮箱格式")
	private String email;
	// 用户的实例
	@Pattern(message="请输入正确的性别",regexp="[/^男$|^女&/]{1}")
	//@Pattern(message="请输入正确的性别",regexp="[\u4E00-\u9FA5]?")
	private String sex;
	
	// 用户头像存于服务器的相对路径
	private String u_img;
	// 用户收藏文章的专栏，一对多关联
//	private Set<YgColumn> ygColumn = new HashSet<>();
	private List<YgColumn> ygColumn;
	// 用户管理钱包，一对一关联
	private YgWallet ygWallet;
	// 用户的商品，一对多关联
	private Set<YgMerch> ygMerch = new HashSet<>();
	// 用户产生的订单，一对多关联
	private Set<YgOrders> ygOrder = new HashSet<>();
	
	public YgUsers(){}
	
	public YgUsers(String username, String nickname, String mobile, String email,
			String sex, String u_img) {
		this.username = username;
		this.nickname = nickname;
		this.mobile = mobile;
		this.email = email;
		this.sex = sex;
		this.u_img = u_img;
	}
	
	
	
public YgUsers(String uid, String username, String password, String nickname, String mobile, String email,
			String sex, String u_img, List<YgColumn> ygColumn, YgWallet ygWallet, Set<YgMerch> ygMerch,
			Set<YgOrders> ygOrder) {
		super();
		this.uid = uid;
		this.username = username;
		this.password = password;
		this.nickname = nickname;
		this.mobile = mobile;
		this.email = email;
		this.sex = sex;
		this.u_img = u_img;
		this.ygColumn = ygColumn;
		this.ygWallet = ygWallet;
		this.ygMerch = ygMerch;
		this.ygOrder = ygOrder;
	}

//	public YgUsers(String uid, String username, String password, String nickname, String mobile, String email,
//			String sex, String u_img, Set<YgColumn> ygColumn, YgWallet ygWallet, Set<YgMerch> ygMerch,
//			Set<YgOrders> ygOrder) {
//		this.uid = uid;
//		this.username = username;
//		this.password = password;
//		this.nickname = nickname;
//		this.mobile = mobile;
//		this.email = email;
//		this.sex = sex;
//		this.u_img = u_img;
//		this.ygColumn = ygColumn;
//		this.ygWallet = ygWallet;
//		this.ygMerch = ygMerch;
//		this.ygOrder = ygOrder;
//	}
	
	

	public void setUid(String uid) {
		this.uid = uid;
	}

	public String getUid() {
		return uid;
	}

	public String getUsername() {
		return username;
	}

	public void setUsername(String username) {
		this.username = username;
	}

	public String getPassword() {
		return password;
	}

	public void setPassword(String password) {
		this.password = password;
	}

	public String getNickname() {
		return nickname;
	}

	public void setNickname(String nickname) {
		this.nickname = nickname;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public String getEmail() {
		return email;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getSex() {
		return sex;
	}

	public void setSex(String sex) {
		this.sex = sex;
	}

	public String getU_img() {
		return u_img;
	}

	public void setU_img(String u_img) {
		this.u_img = u_img;
	}

	public List<YgColumn> getYgColumn() {
		return ygColumn;
	}

	public void setYgColumn(List<YgColumn> ygColumn) {
		this.ygColumn = ygColumn;
	}

	public YgWallet getYgWallet() {
		return ygWallet;
	}

	public void setYgWallet(YgWallet ygWallet) {
		this.ygWallet = ygWallet;
	}

	public Set<YgMerch> getYgMerch() {
		return ygMerch;
	}

	public void setYgMerch(Set<YgMerch> ygMerch) {
		this.ygMerch = ygMerch;
	}

	public Set<YgOrders> getYgOrder() {
		return ygOrder;
	}

	public void setYgOrder(Set<YgOrders> ygOrder) {
		this.ygOrder = ygOrder;
	}

	@Override
	public String toString() {
		return "YgUsers [uid=" + uid + ", username=" + username + ", password=" + password + ", nickname=" + nickname
				+ ", mobile=" + mobile + ", email=" + email + ", sex=" + sex + ", u_img=" + u_img + ", ygColumn="
				+ ygColumn + ", ygWallet=" + ygWallet + ", ygMerch=" + ygMerch + ", ygOrder=" + ygOrder + "]";
	}

//	@Override
//	public String toString() {
//		return "YgUsers [uid=" + uid + ", username=" + username + ", password=" + password + ", nickname=" + nickname
//				+ ", mobile=" + mobile + ", email=" + email + ", sex=" + sex + ", u_img=" + u_img + ", ygColumn="
//				+ ygColumn + ", ygWallet=" + ygWallet + ", ygMerch=" + ygMerch + ", ygOrder=" + ygOrder + "]";
//	}
	
	
	
}
